package tests;

import java.util.LinkedList;

import visitorpattern.CreatesVisitorsAndVisitsGraph;
import bookworm.Book;

public class GetBooksFromSpecificTagTest 
{
	public static void main(String args[])
	{
		PrintTextInJFrame logWindow = new PrintTextInJFrame("log window for graph creation and visitor result");
		
		CreatesVisitorsAndVisitsGraph iteratesSameTag = new CreatesVisitorsAndVisitsGraph();
		logWindow.write("now getting books from tag horror");
		LinkedList<Book> booksFromTag =
				iteratesSameTag.getBooksFromSpecificTag("horror");
		System.out.println("/////////////visitor finished his job/////////");
		for(int i = 0; i < booksFromTag.size(); i++)
		{
			Book oneBook = booksFromTag.get(i);
			String titleOfOneBook = oneBook.getBookName();
			logWindow.write(titleOfOneBook);
		}
	}

}
